package com.wzh.rabbitmq;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: WZH
 * @time: 2021/6/16 14:24
 */
@Component
//监听指定的消息队列
public class SimpleQueueCustomer {

    //@RabbitHandler修饰的方法中实现接受到消息后的处理逻辑
    @RabbitListener(queues="TestDirectQueue")
    @RabbitHandler
    public void receive(String content){
        System.out.println("SimpleQueueCustomer");
        System.out.println("来SimpleQueueProducer的信息："+content);
    }
}